import Vue from 'vue'
import FastClick from 'fastclick'
import VueBus from 'vue-bus'
import store from 'store'
import router from 'src/router'

import * as constants from 'src/AppConstants'
import common_mixins from 'mixins/common_mixins'

import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import WeChat from 'plugins/wechat'
import 'normalize.css'

require('plugins/http')
require('libs/flexible')
require('libs/rem')
require('animate.css')

require('es6-promise').polyfill()

import App from './App'

import objectAssign from 'object-assign'

Vue.use(VueBus) // 全局事件
Vue.use(WeChat)
Vue.use(MintUI)

FastClick.attach(document.body)

// 调试参数配置
Vue.config.productionTip = false
Vue.config.devtools = process.env.NODE_ENV !== constants.ENV_PRODUCTION

// bug报告SDK配置
if (process.env.NODE_ENV !== constants.ENV_PRODUCTION) {
    // web控制台
    require('vconsole')
}

// 全局混合
Vue.mixin(common_mixins)

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app-box')